package com.jiumi.baseconfig.service.impl;

import java.util.List;
import com.jiumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jiumi.baseconfig.mapper.BaseTeacherMapper;
import com.jiumi.baseconfig.domain.BaseTeacher;
import com.jiumi.baseconfig.service.IBaseTeacherService;

/**
 * 授课老师Service业务层处理
 *
 * @author jiumi
 * @date 2023-05-21
 */
@Service
public class BaseTeacherServiceImpl implements IBaseTeacherService
{
    @Autowired
    private BaseTeacherMapper baseTeacherMapper;

    /**
     * 查询授课老师
     *
     * @param id 授课老师主键
     * @return 授课老师
     */
    @Override
    public BaseTeacher selectBaseTeacherById(Long id)
    {
        return baseTeacherMapper.selectBaseTeacherById(id);
    }

    /**
     * 查询授课老师列表
     *
     * @param baseTeacher 授课老师
     * @return 授课老师
     */
    @Override
    public List<BaseTeacher> selectBaseTeacherList(BaseTeacher baseTeacher)
    {
        return baseTeacherMapper.selectBaseTeacherList(baseTeacher);
    }

    /**
     * 新增授课老师
     *
     * @param baseTeacher 授课老师
     * @return 结果
     */
    @Override
    public int insertBaseTeacher(BaseTeacher baseTeacher)
    {
        baseTeacher.setCreateTime(DateUtils.getNowDate());
        return baseTeacherMapper.insertBaseTeacher(baseTeacher);
    }

    /**
     * 修改授课老师
     *
     * @param baseTeacher 授课老师
     * @return 结果
     */
    @Override
    public int updateBaseTeacher(BaseTeacher baseTeacher)
    {
        baseTeacher.setUpdateTime(DateUtils.getNowDate());
        return baseTeacherMapper.updateBaseTeacher(baseTeacher);
    }

    /**
     * 批量删除授课老师
     *
     * @param ids 需要删除的授课老师主键
     * @return 结果
     */
    @Override
    public int deleteBaseTeacherByIds(Long[] ids)
    {
        return baseTeacherMapper.deleteBaseTeacherByIds(ids);
    }

    /**
     * 删除授课老师信息
     *
     * @param id 授课老师主键
     * @return 结果
     */
    @Override
    public int deleteBaseTeacherById(Long id)
    {
        return baseTeacherMapper.deleteBaseTeacherById(id);
    }
}
